<?php

class AppConfig {

	public $id;

	public $defaultAction;

	public $actions;

	public $filters;

	public $resultTypes;

	public $globals;
	
	//[2009-05-26] Implement Feature Request 2777528
	//----------------------------------------------
	public $globalFilters;


	public function toXml(){
		$outXml = "<application id=\"{$this->id}\" default-action=\"{$this->defaultAction}\">";

		$outXml .= '<globals>';
		foreach($this->globals as $key => $value){
			$outXml .= "<global name=\"$key\" value=\"$value\"/>";
		}
		$outXml .= '</globals>';


		$outXml .= '<resultTypes>';
		foreach($this->resultTypes as $rsType){
			$outXml .= $rsType->toXml();	
		}
		$outXml .= '</resultTypes>';


		$outXml .= '<filters>';
		foreach($this->filters as $filter){
			$outXml .= $filter->toXml();	
		}
		$outXml .= '</filters>';


		$outXml .= '<actions>';
		foreach($this->actions as $action){
			$outXml .= $action->toXml();	
		}
		$outXml .= '</actions>';

		$outXml .= "</application>";
		return $outXml;
	}
}

